<template>
  <div class="wrapper">
    <!-- <div v-red="'green'">123</div> -->
    <el-table
      :data="$store.state.admin.adminLog"
      :border="true"
      v-loading="$store.state.isLoading"
      style="width: 100%"
    >
      <el-table-column label="登陆时间" width="220">
        <template slot-scope="scope">
          <i class="el-icon-time"></i>
          <span style="margin-left: 10px">{{ scope.row.loginTime|date }}</span>
        </template>
      </el-table-column>
      <el-table-column label="管理员账号" width="180">
        <template slot-scope="scope">{{scope.row.adminName}}</template>
      </el-table-column>
      <el-table-column label="操作">
        <template slot-scope="scope">
          <el-button
            size="mini"
            type="danger"
            @click="$store.dispatch('deleleAdminLog',scope.row._id)"
          >删除</el-button>
        </template>
      </el-table-column>
    </el-table>
    <!-- <div class="toolbar">
      <el-pagination
        background
        layout="prev, pager, next"
        :page-count="$store.state.admin.pageSum"
        @current-change="pageIndex=>this.$store.dispatch('getAdminLog', pageIndex)"
      ></el-pagination>
    </div>-->
    <pageInfo action-name="getAdminLog"></pageInfo>
  </div>
</template>

<script>
export default {
  components: {},
  props: {},
  data() {
    return {};
  },
  watch: {},
  computed: {},
  methods: {
    // fn(pageIndex) {
    //   // console.log(pageIndex)
    //   this.$store.dispatch("getAdminLog", pageIndex);
    // }
  },
  created() {},
  mounted() {
    // this.$store.dispatch("getAdminLog");

    // 访问接口
    // this.$http.get('/adminLog') 
    // .then(data=>{
    //   console.log(data)
    // })
  }
  // directives:{
  //   red(el,bind){
  //     el.innerText = '加载中......'
  //     el.style.background=bind.value

  //   }
  // }
};
</script>
<style lang="css" scoped>
.toolbar {
  background: #f4f4f4;
  padding: 10px;
}
</style>